package com.tiancheng.trade.payment.mapper;

import com.tiancheng.trade.payment.model.PaymentOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;

/**
 * 支付流水持久化接口
 */
@Repository
public interface PaymentOrderMapper extends TYBaseMapper<PaymentOrder> {

    /**
     * 统计指定商户时间范围内已支付的流水总金额
     * @param merchantCode
     * @param startTime
     * @param endTime
     * @param paymentChannel
     * @return
     */
    long totalAmountOfMerchant(@Param("merchantCode") String merchantCode, @Param("startTime") LocalDateTime startTime,
                               @Param("endTime") LocalDateTime endTime, @Param("paymentChannel") String paymentChannel);
}
